<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div class=" definewidth m20">
		<form action="/sys_admin/accountrecharge/received_payments/" method="get" name="form1" id="form1" class="form-inline definewidth m20">
  			用户名称：<input type="text" id="username" name="username" style="width: 100px;" value="<?php echo $username?>" />
  			所属客服：<input type="text" id="kefu_username" name="kefu_username" style="width: 100px;" value="<?php echo $kefu_username?>" />
  			状态：<select id="fstatus" name="fstatus">
  				<option value="-1" <?php if($fstatus==-1){?>selected="selected"<?php }?>>所有</option>
  				<?php foreach($borrow_collection_status as $key=>$value){?>
  				<option value="<?php echo $key?>" <?php if($fstatus==$key){?>selected="selected"<?php }?>><?php echo $value;?></option>
  				<?php }?>
  			</select>
  			是否内部账号：<select id="is_self" name="is_self">
  				<option value="-1" <?php if($is_self==-1){?>selected="selected"<?php }?>>所有</option>
  				<?php foreach($user_self as $key=>$value){?>
  				<option value="<?php echo $key?>" <?php if($is_self==$key){?>selected="selected"<?php }?>><?php echo $value;?></option>
  				<?php }?>
  			</select>
  			时间：<input type="text" id="start_repay_time" name="start_repay_time" style="width: 100px;" value="<?php echo $start_time;?>"  onfocus="WdatePicker()" />-----
  			<input type="text" id="end_repay_time" name="end_repay_time" style="width: 100px;" value="<?php echo $end_time;?>"  onfocus="WdatePicker()" />
  			<button type="button" class="btn btn-primary"  onclick="this.form.submit();" >查询</button>
  		</form>
		<table class="table table-bordered table-hover definewidth m10">
			 <thead>
			    <tr>
			       <th><strong>用户编号</strong></th>
					<th><strong>用户名称</strong></th>
					<th><strong>所属客服</strong></th>
					<th><strong>期数</strong></th>
					<th><strong>借款标题</strong></th>
					<th><strong>还款金额</strong></th>
					<th><strong>还款状态</strong></th>
					<th><strong>估计还款时间</strong></th>
			    </tr>
			   </thead>
			    <?php foreach($list as $key=>$borrow){?>
			  <tr>
				<td><?php echo $borrow['user_id'];?></td>
				<td><?php echo $borrow['username'];?></td>
				<td><?php echo $kefu_list[$borrow['kefu_userid']]['username'];?></td>
				<td><?php echo ($borrow['forder']+1).'/'.$borrow['time_limit'];?></td>
				<td><?php echo $borrow['title'];?></td>
				<td><?php echo number_format($borrow['money'],2);?></td>
				<td><?php echo $borrow_collection_status[$borrow['fstatus']];?></td>
				<td><?php if($borrow['repay_time'] == 0){echo "";}else{echo date('Y-m-d H:i',$borrow['repay_time']);}?></td>
			  </tr>
			  <?php }?>
			  	<tr>
			  <tr>
			  	<td colspan="12"  class="page">总预还金额：<font style="color:#e40011"><?php echo $totalmoney;?>元</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->pagination->create_links();?>共<?php echo $count;?>条记录</td>
			  </tr>
			  	<td colspan="8"  class="page"><?php echo $this->pagination->create_links();?></td>
			  	</tr>
		</table>
</div>

